project(7CunYaoKongQi)
cmake_minimum_required(VERSION 3.20)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 99)

add_compile_options(-std=c99 -Wall)
add_compile_options(-Wno-padded -Wno-reserved-identifier -Wno-newline-eof -Wno-c11-extensions -Wno-gnu-zero-variadic-macro-arguments -Wno-static-in-inline -Wno-unknown-warning-option -Wno-double-promotion -Wno-declaration-after-statement -Wno-switch-enum -Wno-sign-conversion -Wno-implicit-int-conversion -Wno-implicit-float-conversion -Wno-unused-parameter -Wno-float-conversion -Wno-unused-function -Wno-unused-variable -Wno-missing-noreturn -Wno-strict-aliasing -Wno-unused-result -Wno-format)

if (CMAKE_BUILD_TYPE AND (CMAKE_BUILD_TYPE STREQUAL "Debug"))
    add_compile_options(-g)
else()
    add_compile_options(-Ofast)
endIF ()

IF (CMAKE_SYSTEM_NAME MATCHES "Generic")
    include_directories(USER)
    #Device
    include_directories(Libraries/nxp_libraries/CMSIS/Include)
    include_directories(Libraries/nxp_libraries/cmsis_drivers)
    include_directories(Libraries/nxp_libraries/drives)
    include_directories(Libraries/nxp_libraries/startup)
    include_directories(Libraries/nxp_libraries/startup/MDK-ARM)
    include_directories(Libraries/nxp_libraries/utilities)
    include_directories(Libraries/nxp_libraries/utilities/debug_console)
    include_directories(Libraries/nxp_libraries/utilities/str)
    include_directories(Libraries/nxp_libraries/xip)
    include_directories(Libraries/nxp_libraries/deceive)
    include_directories(Libraries/nxp_libraries/components/serial_manager)
    include_directories(Libraries/nxp_libraries/components/uart)
    include_directories(Libraries/nxp_libraries/components/lists)
    include_directories(Libraries/nxp_libraries/components/osa)
    include_directories(Libraries/nxp_libraries/components/serial_manager/usb_cdc_adapter)
    include_directories(Libraries/nxp_libraries/middleware/usb/include)
    include_directories(Libraries/nxp_libraries/middleware/usb/phy)
    include_directories(Libraries/nxp_libraries/middleware/usb/device)
    include_directories(Libraries/nxp_libraries/middleware/sdmmc/inc)
    include_directories(Libraries/nxp_libraries/middleware/sdmmc/port)
    include_directories(Libraries/nxp_libraries/middleware/sdmmc/port/usdhc)
    include_directories(Libraries/nxp_libraries/middleware/sdmmc/port/usdhc/interrupt)
    include_directories(Libraries/nxp_libraries/middleware/sdmmc/src)
    include_directories(Libraries/nxp_libraries/middleware/fatfs/source)
    include_directories(Libraries/nxp_libraries/middleware/fatfs/source/fsl_sd_disk)
    include_directories(Libraries/nxp_libraries)
    include_directories(Libraries/nxp_libraries/CMSIS)
    include_directories(Libraries/nxp_libraries/cmsis_drivers)
    include_directories(Libraries/nxp_libraries/components)
    include_directories(Libraries/nxp_libraries/deceive)
    include_directories(Libraries/nxp_libraries/drives)
    include_directories(Libraries/nxp_libraries/middleware)
    include_directories(Libraries/nxp_libraries/startup)
    include_directories(Libraries/nxp_libraries/utilities)
    include_directories(Libraries/nxp_libraries/xip)

    include_directories(Libraries/seekfree_libraries)
    include_directories(Libraries/seekfree_libraries/board)
    include_directories(Libraries/seekfree_libraries/common)
    include_directories(libraries/hxPrintf)
    #SCNS
    include_directories(Libraries/scnsBsp/RT1064_seekfree)
    include_directories(Libraries/scns/src)
    add_subdirectory(libraries/hxPrintf)
    #Device
    add_subdirectory(Libraries/seekfree_libraries)
    add_subdirectory(Libraries/nxp_libraries)
    #SCNS
    add_subdirectory(Libraries/scnsBsp/RT1064_seekfree)
    add_subdirectory(Libraries/scns)

    add_subdirectory(USER/)
else ()
    include_directories(VM)
    #SCNS
    include_directories(Libraries/scnsBsp/windows)
    include_directories(Libraries/scns/src)
    #JCTO
    include_directories(Libraries/jcto)
    include_directories(libraries/hxPrintf)
    add_subdirectory(libraries/hxPrintf)
    #SCNS
    add_subdirectory(Libraries/scnsBsp/windows)
    add_subdirectory(Libraries/scns)
    #JCTO
    add_subdirectory(Libraries/jcto)

    link_libraries(m)

    add_subdirectory(VM/)
ENDIF ()
